package com.ldx.eduline.college.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ldx.eduline.college.entity.EduSubject;
import com.ldx.eduline.college.entity.EduTeacher;
import com.ldx.eduline.college.service.EduSubjectService;
import com.ldx.eduline.common.bean.R;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 课程科目 前端控制器
 * </p>
 *
 * @author ldx
 * @since 2020-12-29
 */
@RestController
@RequestMapping("/college/subject")
public class EduSubjectController {

    @Autowired
    private EduSubjectService eduSubjectService;

    @GetMapping()
    @ApiOperation("分页查询")
    public R subjectAllList(){
        List<EduSubject> subjectTreeList = eduSubjectService.tree();
        // 组装成tree

        return R.success().addData("subjectList", subjectTreeList);
    }


}

